package com.victor.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.victor.dao.PartnerDao;
import com.victor.entity.activity_tuikuan.ActJifen;
import com.victor.entity.activity_tuikuan.ActManjian;
import com.victor.entity.activity_tuikuan.ActMiaosha;
import com.victor.entity.activity_tuikuan.ActTuangou;
import com.victor.entity.activity_tuikuan.TuikuanSetup;
import com.victor.entity.partner.PartnerType;
import com.victor.entity.partner.PartnerUser;
import com.victor.entity.partner.food.FoodMeal;
import com.victor.entity.partner.food.FoodMealDayUse;
import com.victor.entity.partner.food.FoodMealKeshou;
import com.victor.entity.partner.food.FoodMealPhoto;
import com.victor.entity.partner.happy.HappyTheme;
import com.victor.entity.partner.happy.HappyThemeKeshou;
import com.victor.entity.partner.happy.HappyThemePhoto;
import com.victor.entity.partner.happy.HappyThemeTime;
import com.victor.entity.partner.hotel.HotelRoom;
import com.victor.entity.partner.hotel.HotelRoomExplain;
import com.victor.entity.partner.hotel.HotelRoomKeshou;
import com.victor.entity.partner.hotel.HotelRoomLabel;
import com.victor.entity.partner.hotel.HotelRoomPhoto;
import com.victor.entity.receive.AppGetFoodEntity;
import com.victor.entity.receive.AppGetHappyEntity;
import com.victor.entity.receive.AppGetHotelEntity;
import com.victor.service.PartnerService;

@Service
public class PartnerServiceImpl implements PartnerService {

	@Autowired
	private PartnerDao partnerDao;

	// 获取商户类别
	@Override
	public List<PartnerType> getPartnerType(String t_type) {
		return partnerDao.getPartnerType(t_type);
	}

	/* 获取合作伙伴商家 */
	// type用户类型(1.酒店.2.美食. 3娱乐)
	// name;商户名
	// brand;// 商家品牌
	// account账号
	// t_id商户类别id
	// business_state; // 营业状态（0营业中 1歇业中 2闭店）
	@Override
	public List<PartnerUser> getPartnerUsers(String type, String name, String brand, String account, String t_id, String business_state) {
		return partnerDao.getPartnerUsers(type, name, brand, account, t_id, business_state);
	}

	// 获取商家详情
	@Override
	public PartnerUser getPartnerUserXQ(String partnerUserid) {
		return partnerDao.getPartnerUserXQ(partnerUserid);
	}

	// 批量删除
	@Override
	public boolean batchDeletePartnerUser(int[] puids) {
		return partnerDao.batchDeletePartnerUser(puids) > 0 ? true : false;
	}

	// 批量冻结
	@Override
	public boolean batchFrozenPartnerUser(int[] puids) {
		return partnerDao.batchFrozenPartnerUser(puids) > 0 ? true : false;
	}

	// 将房间信息添加入数据库并返回酒店房间id
	@Override
	public int addHotelRoom(HotelRoom hotelRoom) {
		return partnerDao.addHotelRoom(hotelRoom);
	}

//	添加标签数据
	@Override
	public int addHotelRoomLabel(HotelRoomLabel hotelRoomLabel) {
		return partnerDao.addHotelRoomLabel(hotelRoomLabel);
	}

//	添加预定说明
	@Override
	public int addHotelRoomExplain(HotelRoomExplain hotelRoomExplain) {
		return partnerDao.addHotelRoomExplain(hotelRoomExplain);
	}

//	添加房间介绍图片
	@Override
	public int addHotelRoomPhoto(HotelRoomPhoto hotelRoomPhoto) {
		return partnerDao.addHotelRoomPhoto(hotelRoomPhoto);
	}

//	退款设置信息
	@Override
	public int addTuikuanSetup(TuikuanSetup tuikuanSetup) {
		return partnerDao.addTuikuanSetup(tuikuanSetup);
	}

//	添加团购活动
	@Override
	public int addActTuangou(ActTuangou actTuangou) {
		return partnerDao.addActTuangou(actTuangou);
	}

//	添加秒杀活动
	@Override
	public int addActMiaosha(ActMiaosha actMiaosha) {
		return partnerDao.addActMiaosha(actMiaosha);
	}

//	满减活动
	@Override
	public int addActManjian(ActManjian actManjian) {
		return partnerDao.addActManjian(actManjian);
	}

//	积分兑换
	@Override
	public int addActJifen(ActJifen actJifen) {
		return partnerDao.addActJifen(actJifen);
	}

//	将美食套餐添加入数据库并返回id
	@Override
	public int addFoodMeal(FoodMeal foodMeal) {
		return partnerDao.addFoodMeal(foodMeal);
	}

//	添加每日可售数量
	@Override
	public int addFoodMealDayUse(FoodMealDayUse foodMealDayUse) {
		return partnerDao.addFoodMealDayUse(foodMealDayUse);
	}

//	添加图片
	@Override
	public int addFoodMealPhoto(FoodMealPhoto foodMealPhoto) {
		return partnerDao.addFoodMealPhoto(foodMealPhoto);
	}

//	将娱乐项目添加入数据库并返回id
	@Override
	public int addHappyTheme(HappyTheme happyTheme) {
		return partnerDao.addHappyTheme(happyTheme);
	}

//	添加娱乐项目图片
	@Override
	public int addHappyThemePhoto(HappyThemePhoto happyThemePhoto) {
		return partnerDao.addHappyThemePhoto(happyThemePhoto);
	}

//	添加时间
	@Override
	public int addHappyThemeTime(HappyThemeTime happyThemeTime) {
		return partnerDao.addHappyThemeTime(happyThemeTime);
	}

	// 上下架房间-- r_upordowntype --0 上架 1下架
	@Override
	public boolean UpOrDownHotelRoom(int hotelRoomid, String r_upordowntype) {
		return partnerDao.UpOrDownHotelRoom(hotelRoomid, r_upordowntype) > 0 ? true : false;
	}

	// 筛选（根据上下架筛选）--p_id商家id r_upordowntype --0 上架 1下架
	@Override
	public List<HotelRoom> shaixuanUporDown(String p_id, String r_upordowntype) {
		return partnerDao.shaixuanUporDown(p_id, r_upordowntype);
	}

	// 获取房间详情---传房间id
	@Override
	public HotelRoom getHotelRoomXQ(String r_id) {
		return partnerDao.getHotelRoomXQ(r_id);
	}

//	查询当日是否已经设置可售
	@Override
	public HotelRoomKeshou getTodayIsSetup(String date, String r_id) {
		return partnerDao.getTodayIsSetup(date, r_id);
	}

//	删除当日设置
	@Override
	public int deleteTodayHotelRoomKeshous(Integer k_id) {
		return partnerDao.deleteTodayHotelRoomKeshous(k_id);
	}

//	添加新的设置
	@Override
	public int addHotelRoomKeshous(HotelRoomKeshou hotelRoomKeshou) {
		return partnerDao.addHotelRoomKeshous(hotelRoomKeshou);
	}

	// 删除房间信息
	@Override
	public boolean delHotelRoom(Integer r_id) {
		return partnerDao.delHotelRoom(r_id) > 0 ? true : false;
	}

	// 修改房间信息
	@Override
	public boolean updHotelRoom(HotelRoom hotelRoom) {
		return partnerDao.updHotelRoom(hotelRoom) > 0 ? true : false;
	}

	// 删除宾馆图片
	@Override
	public boolean delHotelRoomPhoto(String photo_id) {
		return partnerDao.delHotelRoomPhoto(photo_id) > 0 ? true : false;
	}

	// ------------------------app
	// 查询宾馆列表
	/*
	 * -- t_id 商户类别表id -- position_city 市搜索 -- position_area 区搜索 -- h_price_start
	 * 价钱搜索开始价格 -- h_price_end 价钱搜索结束价格 -- h_star 星级搜索
	 */
	@Override
	public List<PartnerUser> appGetHotelList(AppGetHotelEntity appGetHotelList) {
		return partnerDao.appGetHotelList(appGetHotelList);
	}

	// 获取推荐宾馆
	@Override
	public List<PartnerUser> appGetTuijian(String position_city, String type) {
		return partnerDao.appGetTuijian(position_city, type);
	}

	// 上下架美食商品 upordowntype 0 上架 1下架
	@Override
	public boolean upOrDownFoodMeal(int foodMealid, String upordowntype) {
		return partnerDao.upOrDownFoodMeal(foodMealid, upordowntype) > 0 ? true : false;
	}

	// 筛选（根据上下架筛选）--p_id商家id upordowntype --0 上架 1下架
	@Override
	public List<FoodMeal> shaixuanUporDownFoodMeal(String p_id, String upordowntype) {
		return partnerDao.shaixuanUporDownFoodMeal(p_id, upordowntype);
	}

	// 获取美食详情
	@Override
	public FoodMeal getFoodMealXQ(String m_id) {
		return partnerDao.getFoodMealXQ(m_id);
	}

	// 美食查询当日是否已经设置可售
	@Override
	public FoodMealKeshou getTodayIsSetupFoodMeal(String date, String m_id) {
		return partnerDao.getTodayIsSetupFoodMeal(date, m_id);
	}

	// 美食删除当日设置
	@Override
	public int deleteTodayFoodMealKeshous(Integer k_id) {
		return partnerDao.deleteTodayFoodMealKeshous(k_id);
	}

//	美食添加新的可售设置
	@Override
	public int addFoodMealKeshous(FoodMealKeshou foodMealKeshou) {
		return partnerDao.addFoodMealKeshous(foodMealKeshou);
	}

//	删除美食套餐
	@Override
	public boolean delFoodMeal(Integer m_id) {
		return partnerDao.delFoodMeal(m_id) > 0 ? true : false;
	}

	// 修改美食套餐
	@Override
	public boolean updFoodMeal(FoodMeal foodMeal) {
		return partnerDao.updFoodMeal(foodMeal) > 0 ? true : false;
	}

	// 删除美食图片
	@Override
	public boolean delFoodMealPhoto(String photo_id) {
		return partnerDao.delFoodMealPhoto(photo_id) > 0 ? true : false;
	}

//	上下架娱乐项目 upordowntype 0 上架 1下架
	@Override
	public boolean upOrDownHappyTheme(int happyThemeid, String upordowntype) {
		return partnerDao.upOrDownHappyTheme(happyThemeid, upordowntype) > 0 ? true : false;
	}

	// 筛选（根据上下架筛选）--p_id商家id upordowntype --0 上架 1下架
	@Override
	public List<HappyTheme> shaixuanUporDownHappyTheme(String p_id, String upordowntype) {
		return partnerDao.shaixuanUporDownHappyTheme(p_id, upordowntype);
	}

	// 获取娱乐项目详情
	@Override
	public HappyTheme getHappyThemeXQ(String t_id) {
		return partnerDao.getHappyThemeXQ(t_id);
	}

	// 娱乐项目查询当日是否已经设置可售
	@Override
	public HappyThemeKeshou getTodayIsSetupHappyTheme(String date, String t_id) {
		return partnerDao.getTodayIsSetupHappyTheme(date, t_id);
	}

//	娱乐项目删除当日设置
	@Override
	public int deleteTodayHappyThemeKeshous(Integer k_id) {
		return partnerDao.deleteTodayHappyThemeKeshous(k_id);
	}

//	娱乐项目添加新的可售设置
	@Override
	public int addHappyThemeKeshous(HappyThemeKeshou happyThemeKeshou) {
		return partnerDao.addHappyThemeKeshous(happyThemeKeshou);
	}

	// 修改娱乐项目
	@Override
	public boolean updHappyTheme(HappyTheme happyTheme) {
		return partnerDao.updHappyTheme(happyTheme) > 0 ? true : false;
	}

	// 删除娱乐项目图片
	@Override
	public boolean delHappyThemePhoto(String photo_id) {
		return partnerDao.delHappyThemePhoto(photo_id) > 0 ? true : false;
	}

	// 查询美食列表
	@Override
	public List<PartnerUser> appGetFoodList(AppGetFoodEntity appGetFoodEntity) {
		return partnerDao.appGetFoodList(appGetFoodEntity);
	}

	// 查询娱乐列表
	@Override
	public List<PartnerUser> appGetHappyList(AppGetHappyEntity appGetHappyEntity) {
		return partnerDao.appGetHappyList(appGetHappyEntity);
	}

}
